package cn.easy.api;

import cn.easy.pojo.Easytrigger;
import cn.easy.vo.TriggerInfoVo;

import java.util.List;

public interface TriggerService {
    // 增加一个新的触发
    void insertTrigger(Easytrigger trigger, String userKey) throws Exception;

    //删除一个触发
    void deleteTrigger(int triggerId, String userKey) throws Exception;

    //更新一个触发
    void updateTrigger(Easytrigger trigger, String userKey) throws Exception;

    //查看一个传感器下所有的触发事件
    List<Easytrigger> searchSensorAllTrigger(Integer sensorId, String userKey) throws Exception;

    /**
     * 获取指定传感器下所有的触发器
     *
     * @param sensorId
     * @param userKey
     * @return
     * @throws Exception
     */
    List<TriggerInfoVo> getSensorAllTriggers(Integer sensorId, String userKey) throws Exception;

    /**
     * 获取一个传感器的信息
     *
     * @param id
     * @return
     * @throws Exception
     */
    Easytrigger getTriggerInfo(Integer id,String userKey) throws Exception;
}
